package com.ruoyi.mng.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mng.mapper.HzMerBalanceLogMapper;
import com.ruoyi.mng.domain.HzMerBalanceLog;
import com.ruoyi.mng.service.IHzMerBalanceLogService;
import com.ruoyi.common.core.text.Convert;

/**
 * 商户额度变更日志Service业务层处理
 * 
 * @author chenqiang
 * @date 2023-04-28
 */
@Service
public class HzMerBalanceLogServiceImpl implements IHzMerBalanceLogService 
{
    @Autowired
    private HzMerBalanceLogMapper hzMerBalanceLogMapper;

    /**
     * 查询商户额度变更日志
     * 
     * @param logId 商户额度变更日志主键
     * @return 商户额度变更日志
     */
    @Override
    public HzMerBalanceLog selectHzMerBalanceLogByLogId(Long logId)
    {
        return hzMerBalanceLogMapper.selectHzMerBalanceLogByLogId(logId);
    }

    /**
     * 查询商户额度变更日志列表
     * 
     * @param hzMerBalanceLog 商户额度变更日志
     * @return 商户额度变更日志
     */
    @Override
    public List<HzMerBalanceLog> selectHzMerBalanceLogList(HzMerBalanceLog hzMerBalanceLog)
    {
        return hzMerBalanceLogMapper.selectHzMerBalanceLogList(hzMerBalanceLog);
    }

    /**
     * 新增商户额度变更日志
     * 
     * @param hzMerBalanceLog 商户额度变更日志
     * @return 结果
     */
    @Override
    public int insertHzMerBalanceLog(HzMerBalanceLog hzMerBalanceLog)
    {
        hzMerBalanceLog.setCreateTime(DateUtils.getNowDate());
        return hzMerBalanceLogMapper.insertHzMerBalanceLog(hzMerBalanceLog);
    }

    /**
     * 修改商户额度变更日志
     * 
     * @param hzMerBalanceLog 商户额度变更日志
     * @return 结果
     */
    @Override
    public int updateHzMerBalanceLog(HzMerBalanceLog hzMerBalanceLog)
    {
        hzMerBalanceLog.setUpdateTime(DateUtils.getNowDate());
        return hzMerBalanceLogMapper.updateHzMerBalanceLog(hzMerBalanceLog);
    }

    /**
     * 批量删除商户额度变更日志
     * 
     * @param logIds 需要删除的商户额度变更日志主键
     * @return 结果
     */
    @Override
    public int deleteHzMerBalanceLogByLogIds(String logIds)
    {
        return hzMerBalanceLogMapper.deleteHzMerBalanceLogByLogIds(Convert.toStrArray(logIds));
    }

    /**
     * 删除商户额度变更日志信息
     * 
     * @param logId 商户额度变更日志主键
     * @return 结果
     */
    @Override
    public int deleteHzMerBalanceLogByLogId(Long logId)
    {
        return hzMerBalanceLogMapper.deleteHzMerBalanceLogByLogId(logId);
    }
}
